package fem2.gui;

import fem2.gui.actions.ExitAction;
//import fem2.gui.actions.HistPlotAction;
import fem2.gui.actions.SaveImageAction;
import fem2.gui.actions.SaveModelAction;
import fem2.gui.actions.ShowConvergenceDialogAction;
import fem2.gui.actions.ShowDofsAction;
import fem2.gui.actions.ShowHardcopyDialogAction;
import fem2.gui.actions.SolveAction;
import fem2.gui.actions.TimeStatisticsAction;
import inf.vtk.pm.PipelineCollection;

import javax.swing.JMenu;
import javax.swing.JMenuBar;

public class HofemMenuBar extends JMenuBar {

	private static final long serialVersionUID = 1L;

	public HofemMenuBar(PipelineCollection pc) {
		add(createFileMenu(pc));
		add(createSolutionMenu(pc));
	}

	private static JMenu createFileMenu(PipelineCollection pc) {
		JMenu m = new JMenu("File");

		m.add(new SaveImageAction());
		m.add(new SaveModelAction());
		m.add(new ShowHardcopyDialogAction(pc));
		m.add(new ExitAction(pc));
		return m;
	}

	private static JMenu createSolutionMenu(PipelineCollection pc) {
		JMenu m = new JMenu("Solution");

		m.add(new SolveAction(pc));
		m.add(new ShowConvergenceDialogAction(pc));
		m.add(new ShowDofsAction(pc));
		m.add(new TimeStatisticsAction(pc));
		// m.add(new HistPlotAction(pc));
		return m;
	}
}
